package com.wen.service.impl;

import com.wen.bean.UserInfoBean;
import com.wen.dao.UserInfoBeanMapper;
import com.wen.service.IUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserServiceImpl implements IUserService {
    //依赖注入

    @Resource
    private UserInfoBeanMapper userInfoBeanMapper;
    /**
     * 用户登录验证业务逻辑处理
     *
     * @param userInfoBean 参数实体类
     * @return 登录验证结果
     */
    @Override
    public boolean doLogin(UserInfoBean userInfoBean) {
        // 调用到层进行登录验证业务逻辑处理
        UserInfoBean userInfoBean1 = userInfoBeanMapper.doLogin(userInfoBean);
        System.out.println("mybatis查询结果："+userInfoBean1);
        //不等于空表示登录成功
        return userInfoBean != null;
    }

    public void setUserInfoBeanMapper(UserInfoBeanMapper userInfoBeanMapper) {
        this.userInfoBeanMapper = userInfoBeanMapper;
    }
}
